package com.copm.demonstrationsystem.service.login.impl;

import com.copm.demonstrationsystem.dao.login.UserDao;
import com.copm.demonstrationsystem.pojo.login.User;
import com.copm.demonstrationsystem.service.login.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.jws.soap.SOAPBinding.Use;

/**
 * @author chuyunfei
 * @date: 2018/6/11
 * @description:
 */
@Service
public class loginServiceImpl implements LoginService {

    @Autowired
    private UserDao userDao;

    @Override
    public User login(User user){

        User real = userDao.findByCount(user.getCount());

        if(real != null){
            if(real.getPassword().equals(user.getPassword())){
                return real;
            }
        }
        return null;
    }
}
